@extends('layouts.app')

@section('web_title','医生管理')

@section('css')
    <link rel="stylesheet" href="{{ asset('css/reservation.css') }}">
@endsection

@section('content')
    <!--内容区域-->
    <div class="row">
        <div class="col-xs-12 content-box">
            <!-- 管理员 用户 -->
            <div class="adminContent">
                <!-- 列表页面 -->
                <div class="doctorList" id="doctorList">
                    <!--搜索栏-->
                    <div class="row">
                        <div class="col-xs-12 background-white">
                            <div class="row searchBox">
                                <div class="col-xs-2 width-020">
                                    <span>姓名</span>
                                    <input maxlength="16" type="text" class="form-control" placeholder="请输入姓名" name="name">
                                </div>
                                <div class="col-xs-2 width-020">
                                    <span>手机号</span>
                                    <input maxlength="11" type="number" class="form-control phoneLength" placeholder="请输入手机号" name="phone">
                                </div>
                                <div class="col-xs-2 width-020">
                                    <span>医院</span>
                                    <select class="form-control m-b margin-bottom-0" name="hospital_id">
                                        @if($hospitals instanceof \Illuminate\Database\Eloquent\Collection)
                                            @foreach($hospitals as $hospital)
                                                <option value="{{ $hospital->id }}">{{ $hospital->name }}</option>
                                            @endforeach
                                        @else
                                            <option value="{{ $hospitals->id }}">{{ $hospitals->name }}</option>
                                        @endif
                                    </select>
                                </div>
                                <div class="col-xs-1 text-center width-006">
                                    <button type="button" class="btn btn-primary" id="doctorManagementSearchBtn">查询</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 按钮操作栏 -->
                    <div class="row padding-tb-20 operationBtnBox">
                        <div class="col-xs-12">
                            <button type="button" class="btn btn-primary" id="addDoctorBtn">添加医生</button>
                            <button type="button" class="btn btn-primary" id="deleteDoctorBtn">删除医生</button>
                        </div>
                    </div>
                    <!--患者列表-->
                    <div class="row">
                        <div class="col-xs-12 reservationListBox" id="doctorListBox">
                            <table class="table-bordered table-hover text-center reservationCenter-table doctorManagement-table">
                                <thead>
                                <tr>
                                    <th><lable><input type="checkbox" class="checkBox" data-id="doctorManagementListBody"></lable></th>
                                    <th>姓名</th>
                                    <th>职称</th>
                                    <th>角色</th>
                                    <th>手机号</th>
                                    {{--<th>预约上线人数</th>--}}
                                    {{--<th>状态</th>--}}
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody id="doctorManagementListBody">
                                <tr data-doctorId="1">
                                    <td><lable><input type="checkbox" class="checkBox">1</lable></td>
                                    <td data-name="name" data-value="张三">张三</td>
                                    <td data-name="title" data-value="1">主任医师</td>
                                    <td data-name="role" data-value="1">医生</td>
                                    <td data-name="phone" data-value="18710000987">18710000987</td>
                                    {{--<td>45</td>--}}
                                    {{--<td>接诊中</td>--}}
                                    <td>
                                        {{--<span class="accept">出诊中</span>--}}
                                        <button type="button" class="btn btn-primary btn-outline editDoctorBtn" data-password="123456">编辑</button>
                                    </td>
                                </tr>
                                <tr data-doctorId="1">
                                    <td><lable><input type="checkbox" class="checkBox">2</lable></td>
                                    <td data-name="name" data-value="张三">张三</td>
                                    <td data-name="title" data-value="1">主任医师</td>
                                    <td data-name="role" data-value="1">医生</td>
                                    <td data-name="phone" data-value="18710000987">18710000987</td>
                                    {{--<td>45</td>--}}
                                    {{--<td>停诊中</td>--}}
                                    <td>
                                        {{--<span class="stop">停诊中</span>--}}
                                        <button type="button" class="btn btn-primary btn-outline editDoctorBtn" data-password="123456">编辑</button>
                                    </td>
                                </tr>
                                <tr data-doctorId="1">
                                    <td><lable><input type="checkbox" class="checkBox">3</lable></td>
                                    <td data-name="name" data-value="张三">张三</td>
                                    <td data-name="title" data-value="1">主任医师</td>
                                    <td data-name="role" data-value="1">护士</td>
                                    <td data-name="phone" data-value="18710000987">18710000987</td>
                                    {{--<td>45</td>--}}
                                    {{--<td>无</td>--}}
                                    <td>
                                        {{--<span class="none">无</span>--}}
                                        <button type="button" class="btn btn-primary btn-outline editDoctorBtn" data-password="123456">编辑</button>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="row margin-top-15">
                        <div class="col-xs-12 pagerBox text-right">
                            <nav>
                                <ul class="pagination pagination-lg" id="managementPager"></ul>
                            </nav>
                        </div>
                    </div>
                </div>
                <!-- 添加编辑页面 -->
                <div class="addDoctor display-none" id="addDoctor">
                    <div class="row">
                        <div class="col-xs-12 padding-lr-0">
                            <div class="ibox float-e-margins">
                                <div class="ibox-title adminTitle">
                                    <h5>医生管理</h5>
                                </div>
                                <div class="ibox-content">
                                    <div class="row searchBox">
                                        <input type="hidden" class="form-control" name="doctor_id">
                                        <div class="col-xs-4">
                                            <span>姓名</span>
                                            <input maxlength="16" type="text" class="form-control" placeholder="请输入姓名" name="name" data-check="checkName">
                                        </div>
                                        <div class="col-xs-4">
                                            <span>角色</span>
                                            <select class="form-control m-b margin-bottom-0" name="role">
                                                <option value="1">医生</option>
                                                <option value="2">护士</option>
                                            </select>
                                        </div>
                                        <div class="col-xs-4">
                                            <span>手机号</span>
                                            <input maxlength="11" type="text" class="form-control" placeholder="请输入手机号" name="phone" data-check="checkPhone">
                                        </div>
                                        <div class="col-xs-4 margin-top-15">
                                            <span>密码</span>
                                            <input maxlength="16" type="text" class="form-control" placeholder="请输入密码" name="password" data-check="checkPassword">
                                        </div>
                                        <div class="col-xs-4 margin-top-15">
                                            <span>职称</span>
                                            <select class="form-control m-b margin-bottom-0" name="title">
                                                @foreach(app('field')->get('doctor.title') as $key => $title)
                                                    <option value="{{ $key }}">{{ $title }}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12 text-center">
                                            <button type="button" class="btn btn-primary btn-outline margin-right-80" id="addDoctorBackBtn">返回</button>
                                            <button type="button" class="btn btn-primary" id="addDoctorSaveBtn">保存</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('js')

    <script src="{{ asset('js/doctorManagement.js') }}"></script>
    <script>
        $('#side-menu li.doctorManagement').addClass('active');//更改导航列表选中样式   不可删除
    </script>
@endsection